package com.wenjie.original.entity.vo.SysAdmin;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.mybatisflex.annotation.RelationManyToMany;
import com.wenjie.original.entity.SysAdmin;
import com.wenjie.original.entity.SysRole;
import com.wenjie.original.entity.common.vo.IResVo;
import com.wenjie.original.entity.common.vo.ISelVo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;


@Data
public class SysAdminVo {

    @Data
    public static class SelVo extends SysAdmin implements ISelVo<SysAdmin> {

        @ApiModelProperty("当前页")
        private Integer pn = 1;

        @ApiModelProperty("页数")
        private Integer ps = 10;

    }

    @Data
    public static class ResVo extends SysAdmin implements IResVo<SysAdmin> {


        @JsonIgnore
        private String password;

        @RelationManyToMany(
                joinTable = "sys_admin_role", // 中间表
                selfField = "sysAdminId", joinSelfColumn = "sys_admin_id",
                targetField = "sysRoleId", joinTargetColumn = "sys_role_id"
        )
        private List<SysRole> sysRoles;

    }


}




